import { createPortal } from "react-dom";

const style: React.CSSProperties = {
  position: "fixed",
  top: "50%",
  left: "50%",
};

// 实际 Modal 组件
const Modal = () => {
  return createPortal(
    <div style={style}>
      <div className="modal-content">
        这是一个Portal使用示例
        <button style={{ marginTop: "10px" }}>关闭</button>
      </div>
    </div>,
    document.body
  );
};

export default Modal;
